import { FN } from "@Tea/model";

export const onTargetKeydown = (e: KeyboardEvent, key: KeyboardEvent["key"], callback: FN) => {
  if (e.key !== key) return

  callback()
}

export const onEnterKeydown = (e: KeyboardEvent, fun: FN)=> onTargetKeydown(e,"Enter", fun)